/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.com.cotelasa.scp.entidad;


import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Jorge
 */
@Entity
@Table(name = "venta_linea_credito",catalog = "bdcotelasa", schema = "cotelasa")
@NamedQueries({
    @NamedQuery(name = "VentaLineaCredito.findAll", query = "SELECT v FROM VentaLineaCredito v"),
    @NamedQuery(name = "VentaLineaCredito.findByIdlinea", query = "SELECT v FROM VentaLineaCredito v WHERE v.idlinea = :idlinea"),
    @NamedQuery(name = "VentaLineaCredito.findByRuc", query = "SELECT v FROM VentaLineaCredito v WHERE v.ruc = :ruc"),
    @NamedQuery(name = "VentaLineaCredito.findByRasonSocial", query = "SELECT v FROM VentaLineaCredito v WHERE v.rasonSocial = :rasonSocial"),
    @NamedQuery(name = "VentaLineaCredito.findByLineaCredito", query = "SELECT v FROM VentaLineaCredito v WHERE v.lineaCredito = :lineaCredito"),
    @NamedQuery(name = "VentaLineaCredito.findByLineaUsada", query = "SELECT v FROM VentaLineaCredito v WHERE v.lineaUsada = :lineaUsada"),
    @NamedQuery(name = "VentaLineaCredito.findByLineaSaldo", query = "SELECT v FROM VentaLineaCredito v WHERE v.lineaSaldo = :lineaSaldo"),
    @NamedQuery(name = "VentaLineaCredito.findByFechaReg", query = "SELECT v FROM VentaLineaCredito v WHERE v.fechaReg = :fechaReg"),
    @NamedQuery(name = "VentaLineaCredito.findByCreditoBase", query = "SELECT v FROM VentaLineaCredito v WHERE v.creditoBase = :creditoBase")})
public class VentaLineaCredito implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @SequenceGenerator(name = "generadorLineaCredito", sequenceName = "cotelasa.venta_linea_credito_id_seq")
    @GeneratedValue(generator = "generadorLineaCredito") 
    @Basic(optional = false)
    @Column(name = "idlinea")
    private Integer idlinea;
    @Size(max = 50)
    @Column(name = "ruc")
    private String ruc;
    @Size(max = 200)
    @Column(name = "rason_social")
    private String rasonSocial;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "linea_credito")
    private double lineaCredito;
    @Column(name = "linea_usada")
    private double lineaUsada;
    @Column(name = "linea_saldo")
    private double lineaSaldo;
    @Column(name = "fecha_reg")
    @Temporal(TemporalType.DATE)
    private Date fechaReg;
    @Column(name = "credito_base")
    private boolean creditoBase;
   

    public VentaLineaCredito() {
    }

    public VentaLineaCredito(Integer idlinea) {
        this.idlinea = idlinea;
    }

    public Integer getIdlinea() {
        return idlinea;
    }

    public void setIdlinea(Integer idlinea) {
        this.idlinea = idlinea;
    }

    public String getRuc() {
        return ruc;
    }

    public void setRuc(String ruc) {
        this.ruc = ruc;
    }

    public String getRasonSocial() {
        return rasonSocial;
    }

    public void setRasonSocial(String rasonSocial) {
        this.rasonSocial = rasonSocial;
    }

    public double getLineaCredito() {
        return lineaCredito;
    }

    public void setLineaCredito(double lineaCredito) {
        this.lineaCredito = lineaCredito;
    }

    public double getLineaUsada() {
        return lineaUsada;
    }

    public void setLineaUsada(double lineaUsada) {
        this.lineaUsada = lineaUsada;
    }

    public double getLineaSaldo() {
        return lineaSaldo;
    }

    public void setLineaSaldo(double lineaSaldo) {
        this.lineaSaldo = lineaSaldo;
    }

    public Date getFechaReg() {
        return fechaReg;
    }

    public void setFechaReg(Date fechaReg) {
        this.fechaReg = fechaReg;
    }

    public boolean getCreditoBase() {
        return creditoBase;
    }

    public void setCreditoBase(boolean creditoBase) {
        this.creditoBase = creditoBase;
    }

   

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idlinea != null ? idlinea.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VentaLineaCredito)) {
            return false;
        }
        VentaLineaCredito other = (VentaLineaCredito) object;
        if ((this.idlinea == null && other.idlinea != null) || (this.idlinea != null && !this.idlinea.equals(other.idlinea))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "prueba.VentaLineaCredito[ idlinea=" + idlinea + " ]";
    }
    
}
